package model

import (
	"database/sql"
	"time"
)

type SysAdmin struct {
	ID          uint         `gorm:"primaryKey;column:id"`
	Username    string       `gorm:"column:username"`
	Nickname    string       `gorm:"column:nickname"`
	Avatar      string       `gorm:"column:avatar"`
	Password    string       `gorm:"column:password" json:"-"`
	Email       string       `gorm:"column:email"`
	Status      StatusEnum   `gorm:"column:status"`
	LastLoginAt sql.NullTime `gorm:"column:last_login_at"`
	CreatedAt   time.Time    `gorm:"column:created_at"`
	UpdatedAt   time.Time    `gorm:"column:updated_at"`
}

func (SysAdmin) TableName() string {
	return "sys_admins"
}

type SysAdminRolePermission struct {
	RoleCode       string         `gorm:"column:role_code"`
	RoleName       string         `gorm:"column:role_name"`
	PermissionPath string         `gorm:"column:permission_path"`
	PermissionName string         `gorm:"column:permission_name"`
	PermissionType PermissionType `gorm:"column:permission_type"`
}
